package com.prs.crm.domain.online;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
/**
 * 
 * @author Yanghao
 *	2012-7-17 10:25:48 论坛
 */
@Entity
@Table(name="on_forumcontent")
public class ForumContent extends BaseEntity{

	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;
	/**标题*/
	private String title;
	/**内容*/
	private String content;
	/**最后评论人*/
	private String lastPerson;
	/**最后评论时间*/
	private String lastTime;
	/**回复数*/
	private Integer replyNum;
	/**人气*/
	private Integer readyNum;
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach;
	
	@ManyToOne
	private ForumManager forumManager;
	
	@OneToMany(fetch=FetchType.LAZY,mappedBy="forumContent")
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private List<ForumContentReply> forumContentReply;
	/**默认为0  加精为1 锁定为2固定为3*/
	private Integer type;
	private Integer guding;
	public Integer getGuding() {
		return guding;
	}
	public void setGuding(Integer guding) {
		this.guding = guding;
	}
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}
	public List<ForumContentReply> getForumContentReply() {
		return forumContentReply;
	}
	public void setForumContentReply(List<ForumContentReply> forumContentReply) {
		this.forumContentReply = forumContentReply;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getLastPerson() {
		return lastPerson;
	}
	public void setLastPerson(String lastPerson) {
		this.lastPerson = lastPerson;
	}
	public String getLastTime() {
		return lastTime;
	}
	public void setLastTime(String lastTime) {
		this.lastTime = lastTime;
	}
	public Integer getReplyNum() {
		return replyNum;
	}
	public void setReplyNum(Integer replyNum) {
		this.replyNum = replyNum;
	}
	public Integer getReadyNum() {
		return readyNum;
	}
	public void setReadyNum(Integer readyNum) {
		this.readyNum = readyNum;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public ForumManager getForumManager() {
		return forumManager;
	}
	public void setForumManager(ForumManager forumManager) {
		this.forumManager = forumManager;
	}
}
